package com.cqhilink.iot.jobstandardmanagement.services.innerservice.impl.rabbitmq;

import com.cqhilink.api.common.utils.UniqueUtil;
import com.cqhilink.iot.jobstandardmanagement.dao.mapper.RabbitMqMessageMapper;
import com.cqhilink.iot.jobstandardmanagement.facade.model.RabbitMqMessage;
import com.cqhilink.iot.jobstandardmanagement.facade.service.rabbitmq.RabbitMqMessageService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.HashMap;
import java.util.Map;

/**
 * 消息队列逻辑处理
 * @author 黄学乾 778142659@qq.com
 * @create 2017-07-21 15:45
 **/
public class RabbitMqMessageServiceImpl implements RabbitMqMessageService {
    @Autowired
    private RabbitMqMessageMapper msgMapper ;

    @Override
    public Map<String, Object> delwithMsg(RabbitMqMessage rabbitMqMsg) throws Exception {
        Map<String,Object> resMap = new HashMap<>();
        try {
            msgMapper.insertSelective(rabbitMqMsg);
        } catch (Exception e) {
            resMap.put(UniqueUtil.uuid(),rabbitMqMsg);
            e.printStackTrace();
        }

        return resMap ;
    }
}
